/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author flintx
 */
import java.util.ArrayList;
import java.util.List;
import junit.framework.*;
import mailctrl.MailLocalConf;
import org.jdom.Element;

public class MailLocalConf_test extends TestCase{

    MailLocalConf maillc;
    List attr;
    @Override
    public void setUp()
    {
        maillc = new MailLocalConf();
        attr = new ArrayList();
        attr.add("hello");
        maillc.setFileConf("hello.xml");
        maillc.loadAppPathFile();
        
    }
    public void testAdd()
    {
        Element newapp;
        newapp = maillc.packageAppInfo("test3", "test...", attr);
        maillc.addAppInfo(newapp);
        maillc.saveAppPathFile();
    }
    public void testDel()
    {
        maillc.delAppInfo("test");
        maillc.saveAppPathFile();
    }
    public void testModify()
    {
        Element newapp;
        newapp = maillc.packageAppInfo("test3", "new test", attr);
        maillc.modifyAppInfo("test3", newapp);
        maillc.saveAppPathFile();
    }

    public static void main(String[] args)
    {
        TestCase test = new MailParser_test();
        junit.textui.TestRunner.run(test);
    }

}
